/**
 * Copyright 2014 lerry
 * 
 * All right reserved.
 * 
 * Dec 16, 2014
 */
package com.bac.utils;

import com.bac.javabeans.Principal;

/**
 * @author lerry
 *
 */
public class Config {
	
	public static class UserGeneralInfo{
		public static Long Id;
		
		public static String nickName;
		
		public static String gender;
		
		public static String phone;

		public static String email;

		public static String idCard;

		public static String address; 
		
		public static String registerDate;
		
		public static boolean firstLogin = false;

		public static boolean gestureEnabled = false;

		public static boolean wealthAccountBanding = false;

		public static boolean paymentPasswordSet = false;
		
		public static void setUserInfo(Principal principal) {
			Id = principal.getId();
			nickName = principal.getNickName();
			gender = principal.getGender();
			phone = principal.getPhone();
			email = principal.getEmail();
			idCard = principal.getIdCard();
			address = principal.getAddress();
			registerDate = principal.getRegisterDate();
			firstLogin = principal.isFirstLogin();
			gestureEnabled = principal.isGestureEnabled();
			wealthAccountBanding = principal.isWealthAccountBanding();
			paymentPasswordSet = principal.isPaymentPasswordSet();
		}
	}
	
	
//	private static final String BASE_PATH_PREFIX = "http://121.43.176.11:10080/bac/app/";
	private static final String BASE_PATH_PREFIX = "http://app.bac365.com:10080/bac/app/";
	
	public static final String USER_ACCOUNT_KEY = "user_account";
	
	public static final String USER_PWD_KEY = "user_pwd";
	
	/**
	 * 注册新用户POST
	 * 
	 * 地址--发送注册请求验证用户名(返回一个激活参数ID) 此时账号为锁定状态
	 * 参数：username用户名,nickname昵称,phone手机号,password密码,gender性别
	 * 返回待激活ID
	 */
	public static final String URL_REGIST = BASE_PATH_PREFIX + "security/register";
	
	/**
	 * 激活账号POST
	 * 
	 * 地址--验证激活参数，账号激活
	 * 参数：id激活参数ID,code验证码
	 */
	public static final String URL_REGIST_ACTIVE = BASE_PATH_PREFIX + "security/active";
	
	/**
	 * 地址--登陆POST
	 * 参数：username(用户名)，password(密码)
	 * 返回：如果返回的json里面有code这个字段，就是登陆失败，弹出msg的内容作为提示，如果没有，则会返回个人信息的json
	 */
	public static final String URL_LOGIN 		= BASE_PATH_PREFIX + "mobile_security_check";
	
	
	/**
	 * 首页--广告栏列表 GET
	 * 返回一个json数组，每个广告有一个id和一个image，image是图片，id是广告id
	 */
	public static final String URL_HOME_ADS = BASE_PATH_PREFIX + "default/advertisements";
	
	
	/**
	 * 首页--广告栏详情 GET
	 * 广告详情页是一个web页面，直接用webview加载
	 * 地址是 Config.URL_HOME_ADS_DETAIL + "?id=" + adIdString;
	 */
	public static final String URL_HOME_ADS_DETAIL = BASE_PATH_PREFIX + "default/advertisement";
	
	/**
	 * 首页--充值利率 GET
	 */
	public static final String URL_RECHARGE_CONFIG = BASE_PATH_PREFIX + "default/recharge-config";
	
	/**
	 * 首页--关于我们的协议
	 * 关于我们是一个web页面，直接用webview加载
	 * 客服电话 4001106262
	 */
	public static final String URL_ABOUT_US = BASE_PATH_PREFIX + "default/about-us";
	
	
	/**
	 * 个人中心--获取当前用户信息GET
	 */
	public static final String URL_CURRENT_USER = BASE_PATH_PREFIX + "customer/getcurrentuser";
	
	/**
	 * 个人中心--注销GET
	 */
	public static final String URL_LOGOUT		= BASE_PATH_PREFIX + "logout";
	
	/**
	 * 个人中心--修改邮寄地址POST
	 * 参数：address
	 * 
	 */
	public static final String URL_CHANGE_POST_ADDRESS = BASE_PATH_PREFIX + "security/change-address";
	/**
	 * 个人中心--修改邮箱地址POST
	 * 参数：email
	 */
	public static final String URL_CHANGE_EMAIL_ADDRESS = BASE_PATH_PREFIX + "security/change-email";
	
	
	/**
	 * 个人中心-我的揩油宝收益流水GET
	 * 参数：type传1，近一月流水
	 */
	public static final String URL_WEALTH_PROFIT = BASE_PATH_PREFIX+"wealth-account/profit-statistic";
	
	/**
	 * 个人中心-我的充值-获取产品订购数量GET
	 * 无参数
	 * 先调此接口，如果返回的json里面count==0,说明没有订购产品，界面上显示没有充值提示。
	 */
	public static final String URL_COUPON_COUNT		= BASE_PATH_PREFIX + "gasonline/counts";
	
	/**
	 * 个人中心-我的充值-获取充值信息GET
	 * 无参数
	 * 如果订购数量count>0,那么需要再调此接口获取充值信息，展示充值界面
	 */
	public static final String URL_COUPON_STATISTIC = BASE_PATH_PREFIX + "gasonline/accounts";
	
	/**
	 * 个人中心-我的账单GET
	 * 参数：
	 * type - 账单分类 0:当月账单，1:历史账单 ；默认为当月账单
	 * size - 历史账单获取大小 默认为100
	 * 直接不传参数取默认数据
	 */
	public static final String URL_GAS_BILL = BASE_PATH_PREFIX + "security/transaction-journals";
	
	
	/**
	 * 个人中心-我的密码-修改登录密码POST
	 * 参数：oldPassword旧密码，password新密码
	 */
	public static final String URL_CHANGE_LOGIN_PASSWORD = BASE_PATH_PREFIX + "security/change/password";
	
	/**
	 * 个人中心-我的密码-修改支付密码POST
	 * 参数：oldPassword旧密码，password新密码
	 */
	public static final String URL_CHANGE_PAY_PASSWORD = BASE_PATH_PREFIX + "security/change/payment-password";
	
	/**
	 * 个人中心-我的密码-用户重置支付密码身份证号验证POST
	 * 参数：idCardNo身份证号
	 * 
	 */
	public static final String URL_COLLECT_IDCARD_NUMBER = BASE_PATH_PREFIX +"security/reset/before-payment-password" ;
	
	/**
	 * 个人中心-我的密码--重置支付密码POST
	 * 参数：code客服给的验证码，paymentPassword新的支付密码
	 */
	public static final String URL_RESET_PAY_PASSWORD = BASE_PATH_PREFIX + "security/reset/payment-password";
	
	/**
	 * 首页--我要加油/查找附近加油站Post
	 * @param longitude:经度</br> latitude:维度 <br>range:范围(米)传5000 <br> city:城市名
	 * 
	 */
	public static final String URL_GAS_STATION	= BASE_PATH_PREFIX + "gas-station/search";
	
	/**
	 * 一键加油-获取用户加油卡充值历史GET
	 * @param pageNo:页码，默认传1<br> pageSize:每页个数，默认传20
	 */
	public static final String URL_GET_CARDS		= BASE_PATH_PREFIX + "card/fuellingcards";
	
	/**
	 * 一键加油-多月充值协议，一个网页，直接用webview加载链接
	 */
	public static final String URL_COUPON_AGREE  = BASE_PATH_PREFIX + "gasonline/agreement";
	
	/**
	 * 一键加油-充值之前进行个人加油卡信息校验Post
	 * @param cardNo:卡号<br> terminalId:终端设备id
	 */ 
	public static final String URL_CHECK_CARD	= BASE_PATH_PREFIX + "card/check-fuellingcard";
	
	/**一键加油-保存加油卡信息Post
	 * 
	 * @param cardNo:卡号<br> userName:持卡人名称
	 */
	public static final String URL_SAVE_CARD	= BASE_PATH_PREFIX + "card/save-fuellingcard";
	
	/**
	 * 一键加油-充值确认-获取用户油卡当前的优惠折扣信息GET
	 * @param amount:用户选择金额<br> cardNo:用户加油卡卡号<br> transactionCode:交易类型GAS001(单月)，GAS004(多月)<br>
	 * cycle:多月充值周期（如果是多月才有此参数）
	 */
	public static final String URL_GET_DISCOUNT		= BASE_PATH_PREFIX + "card/discount";
	
	/**
	 * 一键加油-揩油宝支付Post<br>
	 * @params amount:金额<br> account:用户账户（1，油卡直充，此次为加油卡卡号。2，聚优金，此处不传。3，惠加油产品，此处为加油卡卡号）
	 * <br>terminalId:终端id<br> transactionCode:交易类型（如 GAS001(一个月),GAS004(多月)）<br>
	 * productCode:充值产品（1.如果是单月充值，此处不传2.如果是多月充值，传月数）<br>
	 * paymentPassword:支付密码
	 */
	public static final String URL_PAY_JUYOUJIN  = BASE_PATH_PREFIX + "wealth-account/payment";
	
	/**
	 * 一键加油-易宝支付接口Post
	 * @param amount:充值金额</br> account:充值账户 </br> terminalId:设备id </br> transactionCode:交易类型<br>
	 * productCode:充值产品
	 * 
	 */
	public static final String URL_YEEPAY		= BASE_PATH_PREFIX + "payment/goyeepayment";
	
	
	/**
	* 地址--获取聚优金协议
	*/
	public static final String URL_AGREEMENT     = BASE_PATH_PREFIX + "wealth-account/wealth-agreement";

	/**
	 * 地址--重置登录密码，验证用户名和手机号
	 */
	public static final String URL_RESET_PWD = BASE_PATH_PREFIX + "security/reset/password";
	/**
	 * 地址--通过验证码重置登录密码
	 */
	public static final String URL_RESET_PWD_BY_CODE = BASE_PATH_PREFIX + "security/reset/password";
	/**
	 * 地址--两个接口的地址，开通聚优金和获取验证码，一个post一个get
	 */
	public static final String URL_RECORD_CODE	 = BASE_PATH_PREFIX + "security/additional-info-record";
	
	
	/**
	 * 地址--惠加油套餐详情，直接加载url
	 */
	public static final String URL_COUPON_DETAIL = BASE_PATH_PREFIX + "gasonline/details";
	
	
	/**
	 * 地址--惠加油套餐
	 */
	public static final String URL_COUPON_PLAN   = BASE_PATH_PREFIX + "gasonline/plans";
	
	/**
	 * 地址--获取充值详情
	 */
	public static final String URL_COUPON_STATISTIC_DETAIL = BASE_PATH_PREFIX + "gasonline/journals";
	
	
	/**
	 * 地址--获取聚优金账户信息
	 */
	public static final String URL_GET_WEALTHACCOUNTINFO = BASE_PATH_PREFIX + "wealth-account/info";
	
	
	/**
	 * 加油站评分
	 */
	public static final String URL_GAS_SCORE = BASE_PATH_PREFIX + "gas-station/rate";
	
	/**
	 * 加油站纠错
	 */
	public static final String URL_GAS_COMMENT = BASE_PATH_PREFIX + "gas-station/feedback";
	
	
	
	
	
}
